﻿using System;
using MyPetShop.Domain;

namespace MyPetShop.Domain
{
	/// <summary>
	/// Description of OrderFactory.
	/// </summary>
	public class OrderFactory
	{
		public static Order MakeOrder(Shopping shopping)
		{
			Order order = new Order();
			
			foreach(var detail in shopping.ShoppingDetails)
			{
				OrderDetail orderDetail = new OrderDetail();
				orderDetail.ItemId = detail.ItemId;
				orderDetail.Quantity = detail.Quantity;
				
				order.AddOrderDetail(orderDetail);
			}
			return order;
		}
	}
}
